#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#define u32 unsigned int
struct key_inf{
	char name[10];
	u32 value;
	u32 irq;
	u32 trig;
};
struct key_inf key_press;

int main()
{
	int fd;
	//fd = open("/dev/drv_key0", O_RDWR|O_NONBLOCK);
	fd = open("/dev/drv_key0", O_RDWR);
	if(fd < 0)
	{
		printf("drv_key0 open err\r\n");
		exit(1);
	}
	while(1)
	{
		read(fd, &key_press, sizeof(key_press));
		printf("app:irq=%d  value=%d\r\n",key_press.irq,key_press.value);
		sleep(1);
	}
	close(fd);
}
